<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html>
<html lang="zh-CN">
<style type="text/css">
	a:link{text-decoration: none; color:blue; font-family: 微软雅黑;}
	a:visited{color:green;}
	a:hover{text-decoration: underline; color:#09f;}
	a:active{text-decoration: blink; color: yellow;}
</style>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta name="renderer" content="webkit">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>项目信息</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
 <div class="Wrapper">
        <div>
           <div id="pageInTab" class="pageInTab">
		   <div tabid="tabA" title="基本信息" lselected="true">
		<form id="fnc_prj_bsc_info_form" >
             <div class="fieldset1 tabel_col clearFix">
              <div class="fieldBox col_100">
                    <div class="label">项目名称</div>
                <div class="field">
                  <span id="fncprjnm" name="fncprjnm">&nbsp;${fncPrjBscInfo.fncprjnm}</span>
                </div>
                <div style="display: none">
                </div>
             </div>
             <div class="fieldBox col_50">
                <div class="label">金融机构</div>
                <div class="field">
                    <span id="fncinsNM" name="fncinsNM">&nbsp;${fncPrjBscInfo.fncinsNM}</span>
                </div>
                <div style="display: none">
                </div>
             </div>
                             <div class="fieldBox col_50">
                    <div class="label">金融机构类型</div>
                    <div class="field">
                         <span id="instypeNM" name="instypeNM">&nbsp;${fncPrjBscInfo.instypeNM}</span>                
                </div>
                <div style="display: none">
                </div>
             </div>
             <div class="fieldBox col_100">
                    <div class="label">融资报价</div>
                <div class="field">
                   <c:choose>
						<c:when test="${pflag!=null && pflag=='004'}">
						    <c:choose>
								<c:when test="${scmBaseInfo.scmSt!=null && scmBaseInfo.scmSt=='1'}"><!-- 已保存，可修改；已审核，不可修改 -->
									<a href="javascript:modifyScmBaseinfo('${fncPrjBscInfo.fncscmid }')">&nbsp;${fncPrjBscInfo.fncscmNM}</a>
								</c:when>
								<c:otherwise>
									<span >&nbsp;${fncPrjBscInfo.fncscmNM}</span>
								</c:otherwise>
					        </c:choose>
						</c:when>
						<c:otherwise>
								<span >&nbsp;${fncPrjBscInfo.fncscmNM}</span>
						</c:otherwise>
					</c:choose>
                </div>
                <div style="display: none">
                </div>
             </div>
           <div class="fieldBox col_50">
                    <div class="label">国家</div>
                <div class="field">
                   <span id="countryNM" name="countryNM">&nbsp;${fncPrjBscInfo.countryNM}</span>
                </div>
                <div style="display: none">
                </div>
             </div>
                
		 <div class="fieldBox col_50">
                <div class="label">业务类型</div>
                <div class="field">
                    <span id="bustypeNM" name="bustypeNM">&nbsp;${fncPrjBscInfo.bustypeNM}</span>
                </div>
                <div style="display: none">
                </div>
              </div>
          <div class="fieldBox col_50">
                    <div class="label">项目金额</div>
                <div class="field">
                  <span id="fncprjamt" name="fncprjamt">&nbsp;${fncPrjBscInfo.fncprjamt/100}</span>
                </div>
                <div style="display: none">
                </div>
             </div>   
                       <div class="fieldBox col_50">
                    <div class="label">融资金额</div>
                <div class="field">
                     <span id="fncfiamt" name="fncfiamt">&nbsp;${fncPrjBscInfo.fncfiamt/100}</span>
                </div>
                <div style="display: none">
                </div>
             </div>    
              <div class="fieldBox col_50">
                    <div class="label">预放款日期</div>
                <div class="field">
                    <input name="expwddate" id="expwddate" type="text"  class="ui-datepicker" value="${fncPrjBscInfo.expwddate}" validate="{required:true}">
                </div>
                <div style="display: none">
                </div>
             </div>       
                <div class="fieldBox col_50">
                    <div class="label">预放款金额</div>
                <div class="field">
                 <input name="prjid" id="prjid" type="hidden" class="ui-textbox" value="${id}">
                 <input name="fncInsId" id="fncInsId" type="hidden" class="ui-textbox" value="${fncPrjBscInfo.fncinsid}">
                    <input name="expwdamt" id="expwdamt" type="text" class="ui-textbox" onblur="formatExpwdAmt(this)" validate="{number:true,required:true}" >
                </div>
                <div style="display: none">
                </div>
             </div> 
             
    
             
               <div class="fieldBox col_50">
                    <div class="label">收款账号</div>
                <div class="field">
                    <input name="accNo" id="accNo" type="text"  value="${fncPrjBscInfo.expwdaccNM}"   validate="{required:true}" >
                    <input name="expwdacc" id="expwdacc" type="hidden" class="ui-textbox" value="${fncPrjBscInfo.expwdacc}">
                 <span id="chooseCst" class="sq-button sq-button-round"  onclick="choosePage()">选择账户</span>
                </div>
                <div style="display: none">
                </div>
             </div>  
               <div class="fieldBox col_50">
                    <div class="label">收款银行</div>
                <div class="field">
                    <input name="expwdbank" id="expwdbank" type="text" class="ui-textbox" readonly="readonly" value="${fncPrjBscInfo.expwdbank}" validate="{required:true}" >
                </div>
                <div style="display: none">
                </div>
             </div>   
             
              <div class="fieldBox col_50">
           <div class="label">授信名称</div>
            <div class="field">
          		<c:choose>
					<c:when test="${pflag!=null && pflag=='004'}">
					    <c:choose>
							<c:when test="${crBaseInfo.crSt!=null && crBaseInfo.crSt=='0'}"><!-- 未授信 可修改；正常，不可修改 -->
								<a href="javascript:modifycrBase('${crBaseInfo.id }')">&nbsp;${crBaseInfo.crNm}</a>
							</c:when>
							<c:otherwise>
								<span>&nbsp;${crBaseInfo.crNm}</span>
							</c:otherwise>
				        </c:choose>
					</c:when>
					<c:otherwise>
						<span>&nbsp;${crBaseInfo.crNm}</span>
					</c:otherwise>
				</c:choose>
            </div>
          </div>  
          <!-- add 授信  产品      by gengchunlan 20180503 -->
	          <div class="fieldBox col_50">
	           <div class="label">产品名称</div>
	            <div class="field">
	            	${fncPrjBscInfo.pdNm}
	            </div>
	          </div>  
	          <div class="fieldBox col_50">
	           <div class="label">授信状态</div>
	            <div class="field">
	            	${crBaseInfo.crStNm}
	            </div>
	          </div>  
	          <div class="fieldBox col_50">
	           <div class="label">报价状态</div>
	            <div class="field">
	            	${scmBaseInfo.scmDes}
	            </div>
	          </div>  
	          <div class="fieldBox col_50">
	           <div class="label">是否出表</div>
	            <div class="field">
	            	${fncPrjBscInfo.isOutNm}
	            </div>
	          </div>   
	       <!-- end by gengchunlan 20180503 -->  
	       <!-- 是否分账  add by gengchunlan 20200304 --> 
         <div class="fieldBox col_50">
               <div class="label">是否分账</div>
                    <div class="field">
                        	<c:if test="${fncPrjBscInfo.isSplitAccount==2}">否</c:if>  
                        	<c:if test="${fncPrjBscInfo.isSplitAccount==1}">是</c:if>  
                    </div>
         </div> 
         <!--分账账户信息-->
         <div class="fieldBox col_100">
                 <div class="field">
                 </div>
         </div>
         <c:if test="${fncPrjBscInfo.isSplitAccount==1}" >
	         <table id="tableBank2" class="sq-formTable no-border" style="width:80%" >
					<thead>
						<tr>
						    <th class="tbLabel" style="text-align: right;background:#e7fef4;width:10% ;">支付通道</th>
							<th class="tbLabel" style="text-align: center;width:30% ;background:#e7fef4;" >分账账户</th>
							<th class="tbLabel" style="text-align: left;width:15% ; background:#e7fef4;border-right: 1px solid #e9e9e9; ">分账比例(%)</th>
							<th class="tbLabel" style="text-align: left;width:10% ; background:#e7fef4; ">是否存在备用通道</th>
							<th class="tbLabel" style="text-align: left;width:20% ; background:#e7fef4;border-right: 1px solid #e9e9e9; ">机构名称</th>
							<th class="tbLabel" style="text-align: center;width:10% ;background:#e7fef4;border-right: 1px solid #e9e9e9; " >机构code</th>
							<th class="tbLabel" style="text-align: center;width:15% ;background:#e7fef4;border-right: 1px solid #e9e9e9; " >操作</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${fncPrjBscInfo.fncPrjSplitAccountList }" var="splitItem">
							<tr>
								<td style="text-align: right;line-height: 20px;">
						        	<c:forEach var="payMayItem" items="${payMayList}">
								     	<c:if test="${payMayItem.key==splitItem.payMay}" > ${payMayItem.value } </c:if> 
							     	</c:forEach>
								</td>
								<td style="text-align: center;line-height: 20px;">${splitItem.splitAccount }</td>
								<td style="border-right: 1px solid #e9e9e9;line-height: 15px;">${splitItem.splitRatio }</td>
								<td style="border-right: 1px solid #e9e9e9;line-height: 10px;">
								  <c:if test="${ empty splitItem.isBack}">否 </c:if> 
								  <c:if test="${not empty splitItem.isBack}">${splitItem.isBack } </c:if> 
								</td>
								<td style="border-right: 1px solid #e9e9e9;line-height: 20px;">${splitItem.fundInsNm }</td>
								<td style="border-right: 1px solid #e9e9e9;line-height: 10px;">${splitItem.insCode }</td>
								<td style="border-right: 1px solid #e9e9e9;line-height: 15px;">
									<c:choose>
										<c:when test="${splitItem.isBack=='是'}">
										  <a href="javascript:void(0)" onclick="openBackView('${splitItem.id }')" >查看备用通道</a>
										</c:when>
										<c:otherwise> 
											<font color='#CCCCCC'>查看备用通道</font>
										</c:otherwise>
									</c:choose>
								</td>
							</tr>
						</c:forEach>
				 	</tbody>
	       		</table>
         </c:if>
         <!-- 分账账户信息 --> 
         <!-- end by gengchunlan  20200326-->   
             </div>           
            </div>
   <div class="btnsBox">
               <span id="saveBtn" class="sq-button sq-button-round" onclick="save()"><!-- <i class="sqBtnIco_10"></i> -->保存</span>
               <span id="cancelBtn" class="sq-button sq-button-round" onclick="cancelBtn()"><!-- <i class="sqBtnIco_14"></i> -->取消</span>
            </div>
 

	         
         
        </form>
        </div>
             
        </div>
        </div>
    </div>
<!-- 查看备用账户弹出框 -->
<div id="openBackDiv" style="display:none;">
    <form id="openBackForm" ><!-- fncPrjId -->
         <div class="sqPanel_body">
             <div id="ligergrid_back" class="sq-grid"  ></div>
         </div>
    </form>
</div>    
	<script type="text/javascript">
	  var pageInApp={
	    		flag:true
	    };
	  var id ='${id}';
	  var selectOrgCd = "";
	   var searchOrgTree = null;
	  var firstNode = null;
	  var textName='${orgTextName}';//节点名称
	  var orgData = null;
		var id ="";//初始值
		var detailFlag = '${detailFlag}';
		var isFlow = '${isFlow}';
		var init_expwddate='${fncPrjBscInfo.expwddate}';
$(function () {
	
	//initPayList();	
	//预放款金额 expwdamt
	var texpwdamt='${fncPrjBscInfo.expwdamt}';
	if(texpwdamt==null || texpwdamt=='undefined' || texpwdamt==''){
	
	}else{
		$('#expwdamt').val(new  Number("${fncPrjBscInfo.expwdamt/100}"),2);
		
	}
	initData();

    $("#fncfiamt").html(fmoney(new  Number("${fncPrjBscInfo.fncfiamt/100}"),2));
    $("#fncprjamt").html(fmoney(new  Number("${fncPrjBscInfo.fncprjamt/100}"),2));
    if(init_expwddate.length == 0 ){
    }else{
    	 var expwddateStr = new Date("${fncPrjBscInfo.expwddate}");
    	 var expwddateStr2 = DateUtils.formatDate(expwddateStr, DateUtils.YYYY_MM_DD);
    	 $("#expwddate").val(expwddateStr2);
    }
   // liger.get("expwdacc").selectValue("${fncPrjBscInfo.expwdacc}"); 
});
	//初始化数据
	function initData(){
		//	initOrgTree();

		
	//	initcombobox();
		
	//	 initTab();
			$("#fnc_prj_bsc_info_form").ligerForm({
			    validate: true
			});
		//	 var ligerForm = liger.get("fnc_prj_bsc_info_form");
	//	 $("#fnc_prj_bsc_info_form").check_ligerFormEditor();
		
		/*  // 设置业务种类默认为禁用
		    var slt=liger.get("loanTypCd");
            slt.setDisabled();
 */
	
		
		
	
		
	}
	var pageInTab = null;
	  var loadedTabs=[]

	
	  

	  
   
	
	//初始化Tab
    function initTab(){
    	 pageInTab = $("#pageInTab").ligerTab({
             height: 'auto',
             contextmenu: false,
             minIframeHeight: GET_minIframeHeight(),
             onBeforeSelectTabItem: function (tabid) {
             	var id = $("#prjid").val();
             		//alert("id="+id);
             	 if(tabid!="tabA"){
 	             	if(id==null||id==''){
 	                	top.$.ligerDialog.SQalert({content:"请先保存项目基本信息", SQ_type: "warning"});
 	                	return false;
 	                } 
             	} 
             },
             onAfterSelectTabItem: function(tabid) {
              //   if (loadedTabs.indexOf(tabid)<0) {
                 	var id = $("#prjid").val();
                 	//alert("id="+id);
                 	 if(tabid!="tabA"){
 	                	if(id==null||id==''){
 	                		 top.$.ligerDialog.SQalert({content: LogUtils.LOG_PRJ__PRD_SELECT_BEFORE, SQ_type: "warning"});
 	                         return false; //验证不通过，不执行以下代码
 	                	}
                 	} 
                     loadedTabs.push(tabid);

            //     };
                 SetIframe_height();
             }
         });

         $.extend(true, pageInApp, {
             pageInTab: pageInTab
         });
    };
	//保存项目基础信息
	function save(){
        var ligerForm = liger.get("fnc_prj_bsc_info_form");
        if (!ligerForm.valid()) {
            top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO,SQ_type: "warning"});
            return false; //验证不通过，不执行以下代码
        }

	    				  var data = ligerForm.getData();
	    			       data["id"]=$("#prjid").val();
	    			      // alert($("#expwdamt").val());
       data["expwdacc"]=$("#expwdacc").val();//收款账户
       data["expwdbank"]=$('#expwdbank').val();//收款银行
       data["expwddate"]=$('#expwddate').val();//预放款日期
	    			       if(data["orgCd"]==""){
	    			       data["orgCd"]='${orgCd}';
	    			       }
       data["expwdamt"] = $("#expwdamt").ligerGetTextBoxManager().getValue();
       var eexpwdamt=$("#expwdamt").ligerGetTextBoxManager().getValue();
       if(eexpwdamt<0){
    	   top.$.ligerDialog.SQalert({content:"预放款金额必须大于等于0！",SQ_type: "warning"});
           return false; 
       }
       console.log(data);
	    			        var url = '<%=path%>/rfbuss/fncprjbscinfo/add.do';

	    			        var wait_dialog;
	    			        $.ajax({
	    			    		type: 'post',
	    			    		dataType:'json',
	    			    		data:data,
	    			    		url: url,
	    			    		beforeSend: function(){
	    					          wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
	    					     },
	    			    		success:function(msg){
	    			    			 wait_dialog.close();
	    			    			 if(msg.success == 1){
	    			    					 top.$.ligerDialog.SQalert({content: "操作成功!",SQ_type: "success"});
	    						          	 	$("#prjid").val(msg.data);
	    						          	 	pageInApp.flag=false;
	    			    			 }else{
	    			    				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
	    			    			 }
	    			    		}
	    			    	});
     	    	
	}
	//取消
	function cancelBtn(){
		  var TAB=top.mainApp.parentTab;
          var currentTabid=TAB.getSelectedTabItemID();
		 top.tab.removeTabItem(currentTabid);
	}
var frilist = [];
<c:if test="${not empty frilist}"> frilist = ${frilist}; </c:if>
var scmlist=[];
<c:if test="${not empty scmlist}"> scmlist = ${scmlist}; </c:if>	
var countrylist=[];
<c:if test="${not empty countrylist}"> countrylist = ${countrylist}; </c:if>
var bustypelist=[];
<c:if test="${not empty bustypelist}"> bustypelist = ${bustypelist}; </c:if>

var firtypelist=[];
<c:if test="${not empty firtypelist}"> firtypelist = ${firtypelist}; </c:if>
	 function initcombobox(){
	  $("#fncscmid").ligerComboBox({ 
	      data: null, 
          selectBoxWidth: 270,
          selectBoxHeight: 150,
	      valueField: "fncScmId", 
	      textField: "fncScmNm",
	      });
	      
	      
	   $("#instypecd").ligerComboBox({
	      data: null, 
          selectBoxWidth: 270,
          selectBoxHeight: 150,
	      valueField: "key", 
	      textField: "value",
	    
	     });
	   
	   
           var combobox=  $("#fncinsid").ligerComboBox({
    	     data:frilist,
             selectBoxWidth: 270,
             selectBoxHeight: 150,
             valueField: "id",
             textField: "fundRasInsNm",
             onSelected: function ()
             {
             var obj=combobox.getSelected();
               var newData1 = new Array();
    
                    for (i = 0; i < firtypelist.length; i++)
                    {
                     
                        if (firtypelist[i].key == obj.insTypeCd)
                        {
                        
                            newData1.push(firtypelist[i]);
                        }
                    }
               liger.get("instypecd").setData(newData1);
               liger.get("instypecd").selectValue(obj.insTypeCd);

      
              //fncscmid
               var newData = new Array();
                    for (i = 0; i < scmlist.length; i++)
                    {
                        if (scmlist[i].fncInsId == obj.id)
                        {
                            newData.push(scmlist[i]);
                        }
                    }
                    liger.get("fncscmid").setData(newData);
              
             }
         });
         
          var ctycombobox=  $("#country").ligerComboBox({
    	     data:countrylist,
             selectBoxWidth: 270,
             selectBoxHeight: 150,
             valueField: "key",
             textField: "value",
             onSelected: function ()
             {
             }
         });
         
        var btcombobox=  $("#bustype").ligerComboBox({
    	     data:bustypelist,
             selectBoxWidth: 270,
             selectBoxHeight: 150,
             valueField: "key",
             textField: "value",
             onSelected: function ()
             {
             }
         });
  	  
            liger.get("bustype").selectValue("${bustype}");
    	   liger.get("country").selectValue("${country}");
    	    liger.get("fncscmid").selectValue("${fncscmid}");
    	    liger.get("fncinsid").selectValue("${fncinsid}"); 
      	    liger.get("fncinsid").selectValue("${fncinsid}"); 
    	     var newData2 = new Array();
    
                    for (i = 0; i < firtypelist.length; i++)
                    {
                     
                        if (firtypelist[i].key == "${instypecd}")
                        {
                        
                            newData2.push(firtypelist[i]);
                        }
                    }
                    
                    //fncscmid
                    var newData3 = new Array();
                         for (i = 0; i < scmlist.length; i++)
                         {
                             if (scmlist[i].fncInsId ==  "${fncinsid}")
                             {
                                 newData3.push(scmlist[i]);
                             }
                         }
               liger.get("fncscmid").setData(newData3);
               liger.get("instypecd").setData(newData2);
               liger.get("instypecd").selectValue("${instypecd}");
               liger.get("fncscmid").selectValue("${fncscmid}");
            
    }
	  function getGridOptions(checkbox)
      {
		  
	//	  var data1="{'Rows':[{'id':170907124000081,'crtUsrId':1,'crtTm':1504762333545,'mdfUsrId':null,'mdfTm':null,'bkId':170805126000081,'bkNm':'平安银行股份有限公司佛山汾江支行','sysBkInfoVO':{'id':170805126000081,'crtUsrId':1000099,'crtTm':1501904652270,'mdfUsrId':null,'mdfTm':null,'bkLvlCd':'1','bkLvlNm':'总行','bkNm':'平安银行股份有限公司佛山汾江支行','bkNo':'307588005558','bkAddr':null,'bkPid':null,'lmNm':null,'lmTel':null,'isValid':1,'isDel':0,'children':null,'isOpen':'启用'},'isOpen':'启用','orgIdsList':null,'sysBkAccOrgRVOList':[],'accNm':'狮桥融资租赁（中国）有限公司','accNo':'15000023311046','accTypCd':'2','accTypNm':'一般户','accRem':null,'isValid':1,'isDel':0},{'id':170805124000064,'crtUsrId':1000076,'crtTm':1501921289344,'mdfUsrId':null,'mdfTm':null,'bkId':170805126000083,'bkNm':'浦发银行天津浦欣支行','sysBkInfoVO':{'id':170805126000083,'crtUsrId':1000076,'crtTm':1501921239986,'mdfUsrId':1,'mdfTm':1503295731994,'bkLvlCd':'2','bkLvlNm':'支行','bkNm':'浦发银行天津浦欣支行','bkNo':'310110000089','bkAddr':null,'bkPid':170805126000082,'lmNm':null,'lmTel':null,'isValid':1,'isDel':0,'children':null,'isOpen':'启用'},'isOpen':'启用','orgIdsList':null,'sysBkAccOrgRVOList':[],'accNm':'狮桥融资租赁（中国）有限公司','accNo':'77080155300002786','accTypCd':'2','accTypNm':'一般户','accRem':null,'isValid':1,'isDel':0},{'id':170805124000063,'crtUsrId':170804165000254,'crtTm':1501912761016,'mdfUsrId':null,'mdfTm':null,'bkId':170805126000081,'bkNm':'平安银行股份有限公司佛山汾江支行','sysBkInfoVO':{'id':170805126000081,'crtUsrId':1000099,'crtTm':1501904652270,'mdfUsrId':null,'mdfTm':null,'bkLvlCd':'1','bkLvlNm':'总行','bkNm':'平安银行股份有限公司佛山汾江支行','bkNo':'307588005558','bkAddr':null,'bkPid':null,'lmNm':null,'lmTel':null,'isValid':1,'isDel':0,'children':null,'isOpen':'启用'},'isOpen':'启用','orgIdsList':null,'sysBkAccOrgRVOList':[],'accNm':'狮桥融资租赁（中国）有限公司','accNo':'1014481286801','accTypCd':'2','accTypNm':'一般户','accRem':null,'isValid':1,'isDel':0},{'id':170805124000062,'crtUsrId':1000068,'crtTm':1501905044243,'mdfUsrId':null,'mdfTm':null,'bkId':170805126000081,'bkNm':'平安银行股份有限公司佛山汾江支行','sysBkInfoVO':{'id':170805126000081,'crtUsrId':1000099,'crtTm':1501904652270,'mdfUsrId':null,'mdfTm':null,'bkLvlCd':'1','bkLvlNm':'总行','bkNm':'平安银行股份有限公司佛山汾江支行','bkNo':'307588005558','bkAddr':null,'bkPid':null,'lmNm':null,'lmTel':null,'isValid':1,'isDel':0,'children':null,'isOpen':'启用'},'isOpen':'启用','orgIdsList':null,'sysBkAccOrgRVOList':[],'accNm':'狮桥融资租赁（中国）有限公司','accNo':'11016027476003','accTypCd':'2','accTypNm':'一般户','accRem':null,'isValid':1,'isDel':0},{'id':170805124000061,'crtUsrId':1000068,'crtTm':1501904865990,'mdfUsrId':null,'mdfTm':null,'bkId':170805126000081,'bkNm':'平安银行股份有限公司佛山汾江支行','sysBkInfoVO':{'id':170805126000081,'crtUsrId':1000099,'crtTm':1501904652270,'mdfUsrId':null,'mdfTm':null,'bkLvlCd':'1','bkLvlNm':'总行','bkNm':'平安银行股份有限公司佛山汾江支行','bkNo':'307588005558','bkAddr':null,'bkPid':null,'lmNm':null,'lmTel':null,'isValid':1,'isDel':0,'children':null,'isOpen':'启用'},'isOpen':'启用','orgIdsList':null,'sysBkAccOrgRVOList':[],'accNm':'121','accNo':'1212','accTypCd':'6','accTypNm':'保理户','accRem':'2323','isValid':1,'isDel':0},{'id':170523124000041,'crtUsrId':1,'crtTm':1495519082943,'mdfUsrId':null,'mdfTm':null,'bkId':170523126000061,'bkNm':'民生银行','sysBkInfoVO':{'id':170523126000061,'crtUsrId':1,'crtTm':1495519024025,'mdfUsrId':null,'mdfTm':null,'bkLvlCd':'1','bkLvlNm':'总行','bkNm':'民生银行','bkNo':'124009110011','bkAddr':'北京阜成门大街','bkPid':null,'lmNm':'吴广','lmTel':'18088110001','isValid':1,'isDel':0,'children':null,'isOpen':'启用'},'isOpen':'启用','orgIdsList':null,'sysBkAccOrgRVOList':[],'accNm':'狮桥融资租赁有限公司','accNo':'130223130223130','accTypCd':'1','accTypNm':'基本户','accRem':null,'isValid':1,'isDel':0},{'id':170103124000001,'crtUsrId':1,'crtTm':1483433203157,'mdfUsrId':null,'mdfTm':null,'bkId':170102126000001,'bkNm':'中国建设银行','sysBkInfoVO':{'id':170102126000001,'crtUsrId':1,'crtTm':1483342930069,'mdfUsrId':null,'mdfTm':null,'bkLvlCd':'1','bkLvlNm':'总行','bkNm':'中国建设银行','bkNo':'324234234','bkAddr':'北京市中关村','bkPid':null,'lmNm':'萌','lmTel':'15110017878','isValid':1,'isDel':0,'children':null,'isOpen':'启用'},'isOpen':'启用','orgIdsList':null,'sysBkAccOrgRVOList':[],'accNm':'1','accNo':'1','accTypCd':'1','accTypNm':'基本户','accRem':'1','isValid':1,'isDel':0}],'Total':7}";		 
		  var instid = $("#fncInsId").val();
          var options = {
        	  method : 'get',	
              columns: [
            	  { display: '开户行名2', name: 'bkNm',  width: 100, minWidth: 60 }, 
	              { display: '账户名称', name: 'accNm',  width: 100, minWidth: 60 },
	              { display: '账号', name: 'accNo', width: 120}
              ], switchPageSizeApplyComboBox: false,
            //  data: $.extend({}, data1),
              url:'<%=path%>/rfbuss/fncprjbscinfo/initPayList2.do',
              pageSize: 10, 
              checkbox: checkbox
          };
          return options;
      }
	 
	  function initPayList(){
	   	  
   
	   	  var expwdaccbox= $("#expwdacc").ligerComboBox({
	   		 width: 150,
             slide: false,
             selectBoxWidth: 500,
             selectBoxHeight: 240,
             valueField: 'accNo',
             textField: 'accNo',
             grid: getGridOptions(true),
             condition: { fields: [{ name: 'accNo', label: '客户', width: 90, type: 'text' }] }
	 	       });
	   	
	     }
	  
		function fmoney(s, n)   
		{   
		   n = n > 0 && n <= 20 ? n : 2;   
		   s = parseFloat((s + "").replace(/[^\d\.-]/g, "")).toFixed(n) + "";   
		   var l = s.split(".")[0].split("").reverse(),   
		   r = s.split(".")[1];   
		   t = "";   
		   for(i = 0; i < l.length; i ++ )   
		   {   
		      t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? "," : "");   
		   }   
		   return t.split("").reverse().join("") + "." + r;   
		} 	
		
		//选择页面
		function choosePage(){
		
	        $.ligerDialog.open({  title: '选择账户',height: 500,width: 850, url: '<%=path%>/rfbuss/fncprjbscinfo/toChooseCompAccPage.do?flag=pwa'});
		}
		//修改授信信息
	    function modifycrBase(id){
			var lgcId=id;
			Add_navTab('PrdSpl_2'+id,'修改授信','<%=path%>/rfbase/crbaseinfo/toAddPage.do?lgcId='+lgcId);
		}
		//修改报价信息
		function modifyScmBaseinfo(_id){
			var timestamp=new Date().getTime();
			Add_navTab( 'tab_scm_bsc_info_mod'+timestamp,'修改融资报价','<%=path%>/rfbase/scmbaseinfo/toModifyPage.do?fncScmId='+_id);
	  	}
		//格式化预放款金额
		function formatExpwdAmt(obj){
			var h="";
			var val=$(obj).val();
			if(val==null || val==''){
				return h;
			}
			h=Math.round((val)*100)/100;
			$('#expwdamt').val(h);
		}
    </script>
<script type="text/javascript">
	//新增 备用通道弹窗
	function  openBackView(mainAccountId){
	   	if(mainAccountId == '' || mainAccountId == null || mainAccountId == 'undefined'){
	   		top.$.ligerDialog.SQalert({content: "请先点击保存按钮，添加主通道!",SQ_type: "success"});
	   		return ;
	   	}
	   $.ligerDialog.open({
           width: 500,
           height: 300,
           isResize: true,
           title : '备用通道',
           target: $("#openBackDiv"),
           onHideDialog: function () {
               clearLigerForm("openBackForm");
           }
       });
		   
	   var ligerForm = $("#openBackForm").ligerForm({validate: true});
	   initBackGrid(mainAccountId);
	   }
	//初始化备用账户信息
	function initBackGrid(mainAccountId) {
		//主账户id
	   	if(mainAccountId == '' || mainAccountId == null || mainAccountId == 'undefined'){
	   		top.$.ligerDialog.SQalert({content: "请先点击保存按钮，添加主通道!",SQ_type: "success"});
	   		return ;
	   	}
	   	var fncPrjId = "${id}";//再融资项目id
	    backGrid = $("#ligergrid_back").ligerGrid({
	            url: '<%=path%>/rfbuss/fncprjbscinfo/initBackList.do?',
		    	method : 'get',
		    	parms:{"fncPrjId":fncPrjId,"mainAccountId":mainAccountId},
		    	async: false,
		    	columns: [
			    		{ display: '备用支付通道', name: 'payMay', width: 100,
							valueField: 'payMay',
							textField: 'payMayNm',
							render: function (item) {
								return item.payMayNm;
							},
							validate: function (value) {
							  if (StringUtils.isEmpty(value)) return "此项为必填项！";
							}
		  	            },
						{ display: '备用分账账户', name: 'splitAccount', width: 200}
		   	  	        ],
		   	  	   usePager: false,
		           root: 'rows',
		           record: 'total',
		           hideLoadButton: true,
		           resizable: false, 
		           width: 470,
		           height: 250,
		           //heightDiff: -2,
				   enabledEdit: true,
		           isScroll: false,
		           checkbox: false,
		           rownumbers: true,
		           allowUnSelectRow: true,
		           alternatingRow: false,
		           enabledSort:false,
		    });
	};
</script>
</body>
</html>